<template>
    <div class="info-attr-module">

        <div style="height:.4rem"></div>
        <div class="attr-data">
            <div class="item">
                <span>用户类型</span>
                <div>{{baseService.userType(userInfo.roleId)}}</div>
            </div>
            <div class="item">
                <span>当前代表队</span>
                <div>{{teamInfo.teamName}}</div>
            </div>
            <div class="item">
                <span>当前领队</span>
                <div>{{teamInfo.realName}}</div>
            </div>
            <div class="item">
                <span>姓名</span>
                <div>{{userInfo.realName}}</div>
            </div>
            <div class="item">
                <span>性别</span>
                <div>{{userInfo.sex =='1'?'男':'女'}}</div>
            </div>
            <div class="item">
                <span>证件类型</span>
                <div>{{idCardType[userInfo.idType]}}</div>
            </div>
            <div class="item">
                <span>证件号码</span>
                <div>{{userInfo.idCard}}</div>
            </div>
            <div class="item">
                <span>参与单位</span>
                <div>{{userInfo.company}}</div>
            </div>
            <div class="item">
                <span>联系方式(手机)</span>
                <div>{{userInfo.phone}}</div>
            </div>
            <div class="item">
                <span>邮箱</span>
                <div>{{userInfo.email}}</div>
            </div>
            <div class="item">
                <span>一寸证件照</span>
                <div><img :src="userInfo.header" class="cert"></div>
            </div>
        </div>
    </div>
</template>

<script lang="ts" setup>

import { ref, reactive, getCurrentInstance } from "vue";
import baseService from "@/service/baseService";
import {Router, useRoute, useRouter} from "vue-router";
const route = useRoute();
let userId = route.query.id;
const  userInfo = ref({
  "id": "",
  "account": "",
  "phone": "",
  "email": "",
  "password": "",
  "realName": "",
  "idType": "1",
  "idCard": "",
  "sex": 1,
  "company": "",
  "header": "",
  "empower": "",
  "roleId": ""
});
const teamInfo =ref({
  "teamName": "",
  "realName": "",
  "phone": "",
  "teamId": "",
  "account": ""
});


const idCardType = ref({
  '1':'居民身份证',
  '2':'临时身份证',
  '3':'港澳居民来往内地通行证',
  '4':'台湾居民来往大陆通行证'
});
baseService.get("/front/spuser/"+userId)
    .then((e)=>{
      userInfo.value=e.data;
    });
baseService.get("/front/spuser/queryUserById?id="+userId)
    .then((e)=>{
      teamInfo.value=e.data;
    });

</script>


<style lang="scss" scoped>
@import "./style.scss";
.cert{
  max-width: 200px; height: auto;
}
</style>
